home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Languages / Harvest C / MPW Int & Lib / Interfaces / Graf3D.h < prev    next >
Text File  |  1991-04-17  |  2KB  |  104 lines

  1. /************************************************************
  2.  
  3. Created: Monday, January 7, 1991 at 6:00 AM
  4.     Graf3D.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.         Copyright Apple Computer, Inc.    1985-1990
  9.         All rights reserved
  10.  
  11. ************************************************************/
  12.  
  13.  
  14. #ifndef __GRAF3D__
  15. #define __GRAF3D__
  16.  
  17. #ifndef __QUICKDRAW__
  18. #include <Quickdraw.h>
  19. #endif
  20.  
  21.  
  22. enum {
  23.  
  24.     radConst = 3754936
  25. };
  26.  
  27. typedef Fixed XfMatrix[4][4]; 
  28.  
  29. struct Point3D {
  30.     Fixed x;
  31.     Fixed y;
  32.     Fixed z;
  33. };
  34.  
  35. typedef struct Point3D Point3D;
  36.  
  37. struct Point2D {
  38.     Fixed x;
  39.     Fixed y;
  40. };
  41.  
  42. typedef struct Point2D Point2D;
  43.  
  44. struct Port3D {
  45.     GrafPtr grPort;
  46.     Rect viewRect;
  47.     Fixed xLeft;
  48.     Fixed yTop;
  49.     Fixed xRight;
  50.     Fixed yBottom;
  51.     Point3D pen;
  52.     Point3D penPrime;
  53.     Point3D eye;
  54.     Fixed hSize;
  55.     Fixed vSize;
  56.     Fixed hCenter;
  57.     Fixed vCenter;
  58.     Fixed xCotan;
  59.     Fixed yCotan;
  60.     char filler;
  61.     char ident;
  62.     XfMatrix xForm;
  63. };
  64.  
  65. typedef struct Port3D Port3D;
  66. typedef Port3D *Port3DPtr, **Port3DHandle;
  67.  
  68.  
  69. #ifdef __cplusplus
  70. extern "C" {
  71. #endif
  72. pascal void InitGrf3d(Port3DHandle port); 
  73. pascal void Open3DPort(Port3DPtr port); 
  74. pascal void SetPort3D(Port3DPtr port); 
  75. pascal void GetPort3D(Port3DPtr *port); 
  76. pascal void MoveTo2D(Fixed x,Fixed y); 
  77. pascal void MoveTo3D(Fixed x,Fixed y,Fixed z); 
  78. pascal void LineTo2D(Fixed x,Fixed y); 
  79. pascal void Move2D(Fixed dx,Fixed dy); 
  80. pascal void Move3D(Fixed dx,Fixed dy,Fixed dz); 
  81. pascal void Line2D(Fixed dx,Fixed dy); 
  82. pascal void Line3D(Fixed dx,Fixed dy,Fixed dz); 
  83. pascal void ViewPort(const Rect *r); 
  84. pascal void LookAt(Fixed left,Fixed top,Fixed right,Fixed bottom); 
  85. pascal void ViewAngle(Fixed angle); 
  86. pascal void Identity(void); 
  87. pascal void Scale(Fixed xFactor,Fixed yFactor,Fixed zFactor); 
  88. pascal void Translate(Fixed dx,Fixed dy,Fixed dz); 
  89. pascal void Pitch(Fixed xAngle); 
  90. pascal void Yaw(Fixed yAngle); 
  91. pascal void Roll(Fixed zAngle); 
  92. pascal void Skew(Fixed zAngle); 
  93. pascal void Transform(const Point3D *src,Point3D *dst); 
  94. pascal short Clip3D(const Point3D *src1,const Point3D *src2,Point *dst1,
  95.     Point *dst2); 
  96. pascal void SetPt3D(Point3D *pt3D,Fixed x,Fixed y,Fixed z); 
  97. pascal void SetPt2D(Point2D *pt2D,Fixed x,Fixed y); 
  98. pascal void LineTo3D(Fixed x,Fixed y,Fixed z); 
  99. #ifdef __cplusplus
  100. }
  101. #endif
  102.  
  103. #endif
  104.